unit uDataModule;

interface

uses
  SysUtils, Classes, DB, ADODB, IniFiles, Forms;

type
  TfrmDataModule = class(TDataModule)
    AdoConn: TADOConnection;
    adoTable: TADOQuery;
    procedure DataModuleCreate(Sender: TObject);
  private
    iniFile: TIniFile;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmDataModule: TfrmDataModule;

implementation

{$R *.dfm}

procedure TfrmDataModule.DataModuleCreate(Sender: TObject);
var
  ConnectionString: string;
begin
  iniFile := TIniFile.Create(GetCurrentDir + 'co.ini');
  try
    ConnectionString := iniFile.ReadString('Common', 'ConnectionString', '');
    AdoConn.ConnectionString := ConnectionString;
//    AdoConn.Connected := True;
  finally
    iniFile.Free;
  end;
end;

end.

